<?php

namespace falcon5\inc\Handlers;

use falcon5\inc\Base\Common;
use falcon5\inc\Base\HandlerInterface;

/**
 * Class Deactivate
 * @package falcon5\inc\Handlers
 * @desc 禁用handler
 */
class Deactivate extends Common implements HandlerInterface
{
    /**
     * 处理插件禁用
     */
    public function handler()
    {
        try {
            error_log('Falcon5: Starting plugin deactivation');
            
//            // 使用迁移服务执行数据库回滚
//            $migrateService = new MigrateService();
//            $result = $migrateService->rollback();
            $result = true;
            
            if ($result) {
                error_log('Falcon5: Plugin deactivation successful');
            } else {
                error_log('Falcon5: Error occurred during plugin deactivation');
            }
            
        } catch (\Exception $e) {
            error_log("Falcon5: Deactivation operation failed: " . $e->getMessage());
        }
    }
}